﻿using HighlightPlus;
using QFramework;

namespace Gp.Scripts.Core
{
    public class InterfuseOutlineState : UnitOutlineState
    {
        protected override void OnApply()
        {
            var com = Model.gameObject.GetOrAddComponent<HighlightEffect>();
            var highlightProfile = Helpers.ResHelper.LoadHighlightProfile("HighlightProfile/Interfuse");
            com.ProfileLoad(highlightProfile);
            com.SetHighlighted(true);
            // todo: 走UI HUD
            com.UpdateMaterialProperties(true);
            com.targetFX = false;
        }

        public override void TriggerHighlight()
        {
            if (!Model.TryGetComponent(out HighlightEffect com)) return;
            com.targetFX = true;
        }

        public override void DisableHighlight()
        {
            if (!Model.TryGetComponent(out HighlightEffect com)) return;
            com.targetFX = false;
            // com.SetHighlighted(false);
        }
    }
}